<?php
namespace soa\mp\dak\v1;

use soa\client;

class dakConn  extends client
{
    /**
     * 服务地址
     * @var string
     */
    public $service_url = 'http://mp.kuaidihelp.com/';
    /**
     * 服务名称
     * @var string
     */
    protected $service_name = 'kuaidihelp_mp';

	public function conn($uid,$platform,$mobile,$extra_info = []){
		return $this->post("api/dak/v1/dakConn/conn",compact('uid','platform','mobile','extra_info'));
	}

	public function getByUser($uid,$platform){
		return $this->post("api/dak/v1/dakConn/getByUser",compact('uid','platform','mobile'));
	}

	public function getMobileByUser($uid,$platform){
		$ret = $this->getByUser($uid,$platform);
		return !empty($ret) && is_array($ret) && isset($ret["mobile"]) && !empty($ret["mobile"]) ? $ret["mobile"] : "";
	}

	public function getByMobile($mobile,$platform = ""){
		return $this->post("api/dak/v1/dakConn/getByMobile",compact('mobile','platform'));
	}
}